from django.test import TestCase

# Create your tests here.

from openpyxl import load_workbook
#
#
# #机种数据导入
# def cn_fz():  #载入产能原表，读取数据
#     # wb = openpyxl.load_workbook('./cn/机种工程面线别产能2022-06-07.xlsx')
#     # sheet1 = wb['sheet1']  #获取sheet1对象
#     wb = load_workbook(r'F:\python_code\dj1.11\dj111\数据导入模版\无锡松下机种数据导入.xlsx')
#     sheet1 = wb.active
#     cn_dict = {}
#     L =[]
#     for row1 in sheet1:
#         row_list1 = []
#         for i in row1:
#             row_list1.append(i.value)
#         L.append(row_list1)
#     # for i in L[1:]:
#         # cn_dict[i[0]] = i[1]
#     list_1 = []
#     # for i in L[1:]:
#     #     dict_1 = {}
#     #     dict_1[L[0][0]] = i[0]
#     #     dict_1[L[0][1]] = i[1]
#     #     dict_1[L[0][2]] = i[2]
#     #     list_1.append(dict_1)
#     # print(cn_dict)
#     wb.close()
#     print(L)
#     return L
# # cn_fz()
#
#
import os

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj111.settings")
    import django
    django.setup()
    from plan import models
    # L = cn_fz()
    # objs = []
    # for i in L[1:]:
    #     obj = models.SKU(name=i[0],cust_id=i[1],is_launched=i[2])
    #     objs.append(obj)
    # models.SKU.objects.bulk_create(objs)
    obj = models.SkuProcessLineCpa.objects.filter(sku_id=1).first()
    print(obj)



